/*
  ID: nemokin1
  PROG: hamming
  LANG: C++
*/

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
 
using namespace std;
 
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define FORD(i,a,b) for(int i=(a);i>=b;--i)
#define FOREACH(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define ALL(c) (c).begin(),(c).end()
 
#define debug(x) cerr<< #x << " = " << (x) << "\n";
#define debugv(v) cerr << #v << " = "; FOREACH(it,v) cerr << *it <<","; cerr << "\n";
#define SIZE(a)  (int(a.size()))
 
template<typename T> inline void checkMax(T& a, T b) {if (b>a) a=b;}
template<typename T> inline void checkMin(T& a, T b) {if (b<a) a=b;}
 
typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef long double ld;
const int INF = 1000000000;

int main() {
    freopen("hamming.in","r",stdin);freopen("hamming.out","w",stdout);
    VI cs(1,0);
    int N,B,D;
    cin >> N >> B >> D;
    
    for(int i = 1; i <= (1<<B); i++){
	bool test = true;
	for(int k = 0; k < cs.size(); k++){
	    if(__builtin_popcount(i^cs[k]) < D){
		test = false;
		break;
	    }
	}
	if(test) cs.push_back(i);
	if(cs.size() == N) break;
    }
    //debugv(cs);
    for(int i = 0; i < cs.size()/10; i++){
    	for(int j = 0; j < 9; j++){
    	    cout << cs[i*10+j] << " ";
    	}
    	cout << cs[i*10+9] << endl;
    }
    int i;
    for(i = 0; i < (int(cs.size()%10) - 1); i++){
    	cout << cs[cs.size()-cs.size()%10+i] << " ";
    }
    if(i != 0) cout << cs[cs.size()-1] << endl;
    exit(0);
}
